From c61313cbfe92d5a34f3d9ee92170a7bab95d3d76 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 28 Jul 2023 09:05:03 +0300 Subject: [PATCH] build: Check for objcopy options Check that objcopy understands the --set-section-alignment option that we are now using. --- meson.build | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index ee75e706c7..4e9d7ca1fa 100644 --- a/meson.build +++ b/meson.build @@ -742,9 +742,11 @@ build_gir = gir.found() and (get_option('introspection').enabled() or glib_compile_resources = find_program('glib-compile-resources') objcopy_supports_add_symbol = false +objcopy_supports_section_alignment = false objcopy = find_program('objcopy', required : false) if objcopy.found() objcopy_supports_add_symbol = run_command(objcopy, '--help', check: false).stdout().contains('--add-symbol') + objcopy_supports_section_alignment = run_command(objcopy, '--help', check: false).stdout().contains('--set-section-alignment') endif ld_is_bfd = false @@ -753,7 +755,7 @@ if ld.found() ld_is_bfd = run_command(ld, '--version', check: false).stdout().contains('GNU ld') endif -if not meson.is_cross_build() and build_machine.cpu_family() == 'x86_64' and build_machine.system() == 'linux' and objcopy.found() and objcopy_supports_add_symbol and ld.found() and ld_is_bfd +if not meson.is_cross_build() and build_machine.cpu_family() == 'x86_64' and build_machine.system() == 'linux' and objcopy.found() and objcopy_supports_add_symbol and objcopy_supports_section_alignment and ld.found() and ld_is_bfd can_use_objcopy_for_resources = true else can_use_objcopy_for_resources = false -- 2.30.2